﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using DevExpress.XtraEditors;
using System.Threading;

namespace QLDV_DA
{
    public partial class frmTienDo : DevExpress.XtraEditors.XtraForm
    {
        private Thread _thread;        

        public frmTienDo()
        {
            InitializeComponent();            
        }

        private void XuLiThread()
        {
            this.StartPosition = FormStartPosition.CenterScreen;
            this.TopMost = true;                  
            Application.Run(this);
        }

        public void ThucHienThread()
        {
            if (_thread == null)
            {
                _thread = new Thread(new ThreadStart(XuLiThread));
                _thread.IsBackground = true;
                _thread.Start();
            }
        }

        public void Thoat()
        {
            // Need to call on the thread that launched this splash        
            if (this.InvokeRequired)
                this.Invoke(new MethodInvoker(Thoat));
            else
                Application.ExitThread();
        }   
    }
}